<template>
	<view class="card">
		<view class="cards" v-for="(item,index) in list" :key="index" @click="toSongList(item.id)">
			<view class="capacity">
				♬{{Math.floor(item.playCount/10000) +'万'}}
			</view>
			<image :src="item.picUrl" mode=""></image>
			<view class="name">
				{{item.name}}
			</view>
		</view>
	</view>
</template>

<script>
	/*
	  卡片参数
	     @ img           图片  
		 @ nameValue     名称
		 @ capacity      播放量
	*/
	export default {
		name: 'praCard',
		props: {
			list: {
				type: Array,
				default: false
			}
		},
		data() {
			return {}
		},
		watch: {

		},
		methods: {
			toSongList(id) {
				uni.navigateTo({
					url: "/pages/songList/songList?id=" + id
				})
			}
		}
	}
</script>
<style lang="scss">
	.card {
		width: 100%;
		box-sizing: border-box;
		display: flex;
		flex-wrap: wrap;
		padding: 0rpx 8rpx;
	}

	.cards {
		width: 30.2%;
		height: 340rpx;
		margin-left: 10rpx;
		margin-right: 10rpx;
	}

	image {
		display: flex;
		width: 100%;
		height: 240rpx;
		border-radius: 10rpx;
	}

	.name {
		font-size: 20rpx;
		padding-top: 6rpx;
	}

	.capacity {
		z-index: 1;
		text-align: right;
		font-size: 28rpx;
		position: relative;
		top: 40rpx;
		right: 4rpx;
		color: #ccc;
	}
</style>
